/*
 * @Author: yao
 * @Date: 2024-11-12 09:19:01
 * @LastEditTime: 2025-02-18 14:18:16
 * @LastEditors: yao
 * @Description:
 * @FilePath: \jdev-web-el\src\api\user.ts
 */
import { Method } from "alova";
import { AlovaInstance } from "@/http/index";
import { setRequestParam } from "@/utils/http";
import { prefixProxy } from "@/utils/utils";
import config from "@/config";

const HTTPTABLE = new Proxy(
  {
    verifyCode: `/b/getPicCaptcha`,
    login: "/b/doLogin",
    getUserResources: "/b/getLoginUser"
  },
  prefixProxy(config.AUTH_PREFIX)
);

export const verifyCode = () => {
  return new Method("GET", AlovaInstance, HTTPTABLE.verifyCode);
};

export const login = (data: any) => {
  return new Method(
    "POST",
    AlovaInstance,
    HTTPTABLE.login,
    {},
    (data)
  );
};

export const getUserResources = () => {
  return new Method(
    "GET",
    AlovaInstance,
    HTTPTABLE.getUserResources,
    {},
  );
};


